$(function(){
    var guanwang={
        data:{
        },
        event:function () {
            $(".img_wrap>li").bind("mouseover",function () {
                $(".img_wrap>li").css("width","7.5%").removeClass("hover");
                $(this).css("width","68%").addClass("hover");
            });
        },
        init:function () {
            var that=this;
            that.event();
            var new_time=new Date().getTime();
            $(".time_wrap b:first").text(Math.ceil((new_time-old_time)/(1000*3600*24*365))+"年");
            $(".time_wrap b:last").text(Math.ceil((new_time-old_time)/(1000*3600*24))+"天");
            JsonP({
                url:guanwangID+"index.php?s=home/work/listWorkQuery",
                data:{
                    id:2
                },
                success:function (res) {
                    console.log(res);
                    if(res.resStatus===1){
                        var body_string="";
                        $.each(res.data,function (i,o_) {
                            var img_string="";
                            $.each(o_.casus_data_list,function (i,o) {
                                if(i===3){
                                    img_string+='<a href="anli.html?class1Id=2&class2Id='+o_.id+'"><div style="background-image:url('+o.images+');background-repeat: no-repeat; background-size:cover;background-position: 50% 50%;"><div><p>查看更多项目>></p></div></div></a>'
                                    return false;
                                }else{
                                    img_string+='<a href="anli_detial.html?caseId='+o.id+'"><div  style="background-image:url('+o.images+');background-repeat: no-repeat; background-size:cover;background-position: 50% 50%;"><div><p>'+o.title+'</p></div></div></a>'
                                }

                            });
                            body_string+='<div class="row" style="margin-bottom: 20px">' +
                                '               <div class="col-md-6 '+(i%2===0?"":"col-md-push-6")+'">' +
                                '                   <div class="gongcheng_text_wrap">' +
                                '                       <p><span>'+((i+1)<10?"0"+(i+1):i+1)+'</span>'+o_.title+'</p>' +
                                '                       <p>'+o_.explian+'</p>' +
                                '                   </div>' +
                                '               </div>' +
                                '               <div class="col-md-6 '+(i%2===0?"":"col-md-pull-6")+'">' +
                                '                   <div class="gongcheng_picture_wrap clearfix">'+img_string+'</div>' +
                                '               </div>' +
                                '           </div>';
                        });
                        $(".pubic_wrap").empty().append(body_string);
                    }
                }
            });
        }
    };

    guanwang.init();
});